package main

import (
	"fmt"
	"log"
	"net/http"
	"xian-server/lib"
	"xian-server/lib/cfg"
	"xian-server/lib/database"
)

func main() {
	// config initialization
	cfg.Setup()
	// database initialization
	database.Setup()
	// web server initialization
	port := fmt.Sprintf(":%d", 90)
	routers := lib.InitRouter()
	server := &http.Server{
		Addr:    port,
		Handler: routers,
	}
	log.Printf("[info] start http server listening :%s", port)

	server.ListenAndServe()
}
